#ifndef __STORMWIDGET_STORMWIDGET_UILIBRARY_CLISTUI_LISTUI_H
#define __STORMWIDGET_STORMWIDGET_UILIBRARY_CLISTUI_LISTUI_H

#include "VerticalLayoutUI.h"
#include "IList.h"

class CControlUI;
class CListHeaderUI;
class CListFooterUI;
class CImagePanelUI;

class CListUI:public CVerticalLayoutUI,public IListUI
{
public:
	CListUI(void);
	virtual ~CListUI(void);
	LPCTSTR GetClass() const;
	UINT GetControlFlags() const;
	LPVOID GetInterface(LPCTSTR pstrName);

	int GetCurSel() const;
	bool SelectItem(int iIndex);

	CListHeaderUI* GetHeader() const;
	CListFooterUI* GetFooter() const;   
	CContainerUI* GetList() const;
	const TListInfoUI* GetListInfo() const;

	CControlUI* GetItem(int iIndex) const;
	int GetCount() const;
	bool Add(CControlUI* pControl);
	bool Remove(CControlUI* pControl);
	void RemoveAll();

	void EnsureVisible(int iIndex);
	void Scroll(int dx, int dy);

	void SetExpanding(bool bExpandable);

	int GetExpandedItem() const;
	bool ExpandItem(int iIndex, bool bExpand = true);

	void SetPos(RECT rc);
	void Event(TEventUI& event);
	void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);

	IListCallbackUI* GetTextCallback() const;
	void SetTextCallback(IListCallbackUI* pCallback);

protected:
	int m_iCurSel;
	int m_iExpandedItem;
	IListCallbackUI* m_pCallback;
	CVerticalLayoutUI* m_pList;
	CListHeaderUI* m_pHeader;
	CListFooterUI* m_pFooter;
	TListInfoUI m_ListInfo;
	//CImagePanelUI* m_pImage;
	
};
#endif //__STORMWIDGET_STORMWIDGET_UILIBRARY_CLISTUI_LISTUI_H
